package com.kongwg.exer1;

public class Cylinder extends Circle{
	
	
	private double length;
	
	public Cylinder(){
		length = 1.0;
		
	}

	public double getLength() {
		return length;
	}

	public void setLength(double length) {
		this.length = length;
	}
	/**
	 * 
	 * @return 圆柱的体积
	 */
	public double findVolume(){
//		return Math.PI *getRadius() *getRadius() * getLength();
		return super.findArea() * getLength();
	}
	
	
	@Override
	public double findArea() {
		return Math.PI * getRadius() *getRadius() +Math.PI * getRadius() *2 *getLength(); 
	}
}
